Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pm:enable should fail by default if hook_requirements() is not met #4874

Merged
merged 1 commit into from
Oct 30, 2021

Conversation

weitzman
Copy link
Member

Fixes #4754

@weitzman weitzman merged commit 5011864 into 11.x Oct 30, 2021
@weitzman weitzman deleted the pm-enable branch October 30, 2021 10:45
@simesy
Copy link
Contributor

simesy commented Jan 23, 2024

Just noting that drush will throw an error, but the caller can bypass the requirement (it's not possible to ignore the requirement in the UI).

I have a module that should never be installed on production (it creates test content) and so I throw an exception in hook_requirements 'install' phase if it's CLI on production.

@wombatbuddy
Copy link

If we run the following command: drush en -y my_module and the hook_requirements returns 'severity' => REQUIREMENT_ERROR then Drush display the error message but still enables the module.
Drush 12.5.2.0
Drupal 10.2.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Next milestone: pm:enable should fail by default if hook_requirements() is not met
3 participants